<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>会员中心</title>
<link rel="stylesheet" type="text/css" href="./Public/Home/css/member.css"/>
<script type="text/javascript" src="Public/uploadify/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="./Public/Home/js/area.js"></script>
<script type="text/javascript" src="./Public/Home/js/style.js"></script>
<!--验证码-->
<script type="text/javascript">
//点击文字，验证码刷新，不刷新页面
window.onload=function(){
    var img = document.getElementById('img');
    var btnp = document.getElementById('btnp');	
    btnp.onclick = function(){
    	img.src = "{{U('Member/Code')}}";
    }
}
</script>
</head>
<body>	
<div class="cover"></div>
	<!--载入公共模板-->
	{{include file="../Common/header"}}
	
<!--current information-->
<div class="now_loc">
	您当前的位置：  
		<!--*******************************************************************-->
		<a href="">会员中心</a>
		<!--<span><<</span>
		<a href="">后台数据</a>
		<span><<</span>
		<a href="">后台数据</a>-->
</div>
<!--end current information-->
	
<!--member infomation-->
<nav id="member_box">
	<div class="member_left">
		<dl>
			<span class="member_left_move">
				<dd class="row_top"></dd>
				<dd>
					<a class="member_max" href="javascript:;"><i class="i0"></i>我的名鞋库首页</a>
				</dd>
			</span>
			<!--<span  class="member_left_move">
				<dt><i></i>交易管理</dt>
				<dd>
					<a class="member_max" href="javascript:;"><i class="i1"></i>我的订单</a>
				</dd>
			</span>-->
			<!--<span  class="member_left_move">
				<dd>
					<a class="member_max" href="javascript:;"><i class="i2"></i>我的评论</a>
				</dd>
			</span>-->
			<!--<span  class="member_left_move">
				<dt><i></i>交易管理</dt>
				<dd>
					<a class="member_max" href="javascript:;"><i class="i3"></i>申请/查询退换货</a>
				</dd>
			</span>-->
			<span  class="member_left_move">
				<dt><i></i>用户管理</dt>
				<dd class="personal">
					<a class="member_max" href="javascript:;"><i class="i4"></i>个人信息</a>
				</dd>
			</span>	
			<span  class="member_left_move">
				<dd>
					<a class="member_max" href="javascript:;"><i class="i5"></i>会员级别</a>
				</dd>
			</span>
			<span  class="member_left_move">
				<dd>
					<a class="member_max" href="javascript:;"><i class="i6"></i>密码管理</a>
				</dd>
			</span>
			<span  class="member_left_move">	
				<dd>
					<a class="member_max" href="javascript:;"><i class="i7"></i>收货地址</a>
				</dd>
			</span>
			<!--<span  class="member_left_move">	
				<dt><i></i>客户服务</dt>
				<dd>
					<a class="member_max" href="javascript:;"><i class="i8"></i>消息中心</a>
				</dd>
			</span>-->
			<span  class="member_left_move">	
				<!--<dd>
					<a class="member_max" href="javascript:;"><i class="i9"></i>在线留言</a>
				</dd>-->
		</dl>
	</div>
	<!--固定的-->
	<div class="member_right">
		<!--个人中心首页-->
		<div class="member_info m1">
			<div class="guid_tit">
				您好 
				<span class="money">{{$data['account']}}</span>
				 欢迎光临名鞋库!
			</div>
			<div class="guid_status">
				<div class="status_left">
					<div class="img">
						<!--**********************************************************-->
						<img align="会员等级图示" src="./public/Home/images/member_stu1.jpg"/>
						注册会员 
						
					</div>
					<div class="status_info">					
						<!--**********************************************************-->
						消费总额：
						<span class="money">￥0.00</span>
						<br />					
						在本等级内消费额：
						<span class="money">￥0.00</span>
						<br />
						消费任意金额的一笔订单即可升级为铜级会员 
					</div>
				</div>
				<div class="status_right">
					<!--<ul>
						<li>
							待付款(
							<span class="money">0</span>
							)
						</li>
						<li>
							待收货(
							<span class="money">0</span>
							)
						</li>
						<li>
							待评论(
							<span class="money">0</span>
							)
						</li>
					</ul>-->
					<div class="guid_center">	
						<!--<a href="">个人信息</a>
						<a href="">密码管理</a>
						<a href="">收货地址管理</a>-->
					</div>
				</div>
			</div>
			<div class="goods_tabs">
				<ul>
					<li><a href="">最新订单<span> (
						<!--*********************************************************-->
						<i>{{$indentNum}}</i>
						)</span></a></li>
				</ul>
			</div>
			<div class="goods_head">
				<table border="0" cellspacing="0" cellpadding="0">
					<tbody>					
						<tr>
							<th style="width:398px">订单商品</th>
							<th>收货人</th>
							<th>订单金额</th>
							<th>订单状态</th>
							<th>操作</th>
							<th>售后服务</th>
						</tr>				
					</tbody>	
				</table>
			</div>
			
			<div class="indent">
			{{foreach from="$orderDataType" key="$k" value="$v"}}
			<table class="goods_detail_tab" border="0" cellspacing="0" cellpadding="0">
				<tbody>	
					<tr>
						<td class="tab_sub" colspan="6">&nbsp;订单编号：

							{{$v['inumber']}}
							　　　下单时间：{{$v['time']}} 
						</td>
					</tr>
					<tr>
						<td style="width:398px;text-align: left;">
							<a class="goods_pic" href="">
								{{foreach from="$v['value']" value="$vv"}}
									<img src="{{$vv['pic']}}"/>
								{{endforeach}}								
							</a>
						</td>
						<td>
							{{$v['consignee']}}	
						</td>
						<td>
							<span class="money">￥{{$v['total']}}</span>
						</td>
						<td>
							{{if value="$v['status']==0"}}
								<span class="c1">未付款</span>
							{{else if value="$v['status']==3"}}							
								<span class="c2">交易完成</span>
							{{endif}}					
						</td>
						<td class="spline">
							<a href="">查看订单</a>
						</td>
						<td style="width: 70px;">--</td>
					</tr>													
				</tbody>				
			</table>
			{{endforeach}}	
			</div>	
		</div>
		
		<!--申请/查询退换货-->
		<!--<div class="member_info m2">
			<div class="guid_tit">
				<i></i>
				申请/查询退换货
			</div>
			<div class="goods_tabs">
				<ul>
					<li><a href="">申请退换货</a></li>					
				</ul>
			</div>
			<div class="goods_head">
				<table border="0" cellspacing="0" cellpadding="0">
					<tbody>					
						<tr>
							<th style="width:398px">订单编号</th>
							<th>订单商品</th>
							<th>订单金额</th>
							<th>下单时间</th>
						</tr>				
					</tbody>	
				</table>
			</div>
			

			<table class="goods_detail_tab" border="0" cellspacing="0" cellpadding="0">
				<tbody>	
					<tr>
						<td style="width:398px;">
								000000000000000
						</td>
						<td>
							后台数据	
						</td>
						<td>
							<span class="money">￥0</span>
						</td>
						<td>
							后台数据	
						</td>
					</tr>				
				</tbody>	
			</table>
		</div>-->

		<!--个人中心-->
		<script type="text/javascript">
			//城市联动
			$(function(){
				//初始化方法
				area.init('area');
				area.init('address');				
				area.init('addressAdit');
			})			
		</script>
		<script type="text/javascript">		
			//用户个人信息异步显示
			$('.personal').click(function(){
				//获取当前用户id
				var uid = $('.uid').val();		
				//发异步
				$.ajax({
					type:"post",
					url:"{{U('Individual/personalShow')}}",
			        data:{uid:uid},
					dataType:'json',
					//服务器返回数据				
					success:function(phpData){
						console.log(phpData);																																
						$('.uname').val(phpData.uname);	// 姓名																						
						$('.mailbox').val(phpData.mailbox);	// 邮箱	
						//性别						
						if(phpData.sex == '男'){
							$('.select_sex_male').attr("checked","checked"); // 邮箱	
						}else{
							$('.select_sex_female').attr("checked","checked");
						}
						$('.phone').val(phpData.phone);	// 电话	
						$('.fixPhone').val(phpData.fixed_phone); // 固定电话							
						//出生日期
						$('#birth1').val(phpData.year); // 年
						$('#birth2').val(phpData.month); // 月
						$('#birth3').val(phpData.day); // 日
						//地区					
						area.init('area');						
						area.selected(phpData.province,phpData.city,phpData.county);					
					}						
				});	
			})
		</script>		

		<div class="member_info m3">
			<form action="{{U('Individual/personalEdit')}}" method="post">			
			<div class="guid_tit">
				<i></i>
				个人信息
				<input type="hidden" class="uid" name="uid" value="{{$_SESSION['user']['uid']}}"/>
			</div>
				<table border="0" cellspacing="0" cellpadding="0">
					<tbody>
						<tr>
							<th>姓名：</th>
							<td>
								<input class="uname" type="text" value="" name="uname"/>
							</td>
						</tr>
						<tr>
							<th>邮箱：</th>
							<td>
								<input class="mailbox " type="text" value="" name="mailbox"/>
							</td>
						</tr>
						<tr>
							<th>性别：</th>
							<td>
							<input class="select_sex_male" type="radio" id="male" value="男" name="sex" />
							<label for="male">男</label>		
							<input class="select_sex_female" type="radio" id="female" value="女" name="sex" />
							<label for="female">女</label>
							</td>
						</tr>
						<tr>
							<th>出生日期：</th>
							<td>
								<select name="birthday[]" id="birth1">
									<option value="">请选择年</option>
									<option value="1990">1990</option>
									<option value="1991">1991</option>
									<option value="1992">1992</option>
									<option value="1993">1993</option>
									<option value="1994">1994</option>
									<option value="1995">1995</option>
									<option value="1996">1996</option>
									<option value="1997">1997</option>
									<option value="1998">1998</option>
									<option value="1999">1999</option>
								</select>
								<select name="birthday[]" id="birth2">
									<option value="">请选择月</option>
									<option value="01">01</option>
									<option value="02">02</option>
									<option value="03">03</option>
									<option value="04">04</option>
									<option value="05">05</option>
									<option value="06">06</option>
									<option value="07">07</option>
									<option value="08">08</option>
									<option value="09">09</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>									
								</select>
								<select name="birthday[]" id="birth3">
									<option value="">请选择日</option>
									<option value="01">01</option>
									<option value="02">02</option>
									<option value="03">03</option>
									<option value="04">04</option>
									<option value="05">05</option>
									<option value="06">06</option>
									<option value="07">07</option>
									<option value="08">08</option>
									<option value="09">09</option>
									<option value="10">10</option>
									<option value="11">11</option>
									<option value="12">12</option>	
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
									<option value="17">17</option>
									<option value="18">18</option>
									<option value="19">19</option>									
									<option value="20">20</option>									
									<option value="21">21</option>									
									<option value="22">22</option>									
									<option value="23">23</option>									
									<option value="24">24</option>									
									<option value="25">25</option>									
									<option value="26">26</option>									
									<option value="27">27</option>									
									<option value="28">28</option>									
									<option value="29">29</option>									
									<option value="30">30</option>									
									<option value="31">31</option>									
								</select>
								
							</td>
						</tr>
						<tr>
							<th>地区：</th>
							<td>
								<select name="address_detail[]" id="area1"></select>
								<select name="address_detail[]" id="area2"></select>									
								<select name="address_detail[]" id="area3"></select>																	
							</td>
						</tr>
						<tr>
							<th>移动电话：</th>
							<td>
								<input class="phone" type="text" name="phone"/>
							</td>
						</tr>
						<tr>
							<th>固定电话：</th>
							<td>
								<input class="fixPhone" type="text" name="fixed_phone"/>
							</td>
						</tr>
						<tr>
							<th>验证码：</th>
							<td>
								<input class="code" name="code" type="text" />
								<!--验证码图片 可点击图片刷新-->
								<img id="img" src="{{U('Member/Code')}}" onClick="this.src='{{U('Member/Code')}}'"/>
								<p id="btnp" >看不清换一张</p>
							</td>
						</tr>
					</tbody>
				</table>
				<!--线-->
				<div class="row"></div>
				<div class="upbtnbox">
					<div class="upbtn">
						<input type="submit" value="保存"/>
					</div>
					<div class="btn_text">
						<p> 注册时间：{{$data['signTime']}}</p>
						<p> 最后登录时间：{{$data['loginTime']}}</p>
					</div>
				</div>
			</form>
		</div>
		
		<!--会员级别-->
		<div class="member_info m6">
			<div class="guid_tit">
				<i></i>
				会员级别
			</div>
			<div class="guid_tit_s">
				<div class="t">
					<!--***********************************************************-->
					您目前的会员级别：
				</div>
			</div>
			<div class="c_mlv_box">
				<div class="lvicon">
					<img align="会员等级图示" src="./Public/Home/images/member_stu1.jpg"/>
					<p>注册会员</p>
				</div>
				在本等级内消费额：
				<span class="money">￥0.00</span>
				<br />
				<br />
				»  消费任何金额的一笔订单,即可升级为
				<br /><br />
				<span class="grade">铜级会员 再消费</span>
				<span class="money">500.00</span>
				<span class="grade">元,即可升级为 银级会员</span>							
			</div>
			<div class="uc_tb_body">
				<table border="0" cellspacing="0" cellpadding="0">
					<tbody>
						<!--***************************************************-->
						<tr>
							<th>注册会员</th>
							<td>：  注册会员有消费不限金额；</td>
						</tr>
						<tr>
							<th>铜级会员</th>
							<td>：  年内消费满￥0.00元；</td>
						</tr>
						<tr>
							<th>银级会员</th>
							<td>：  年内消费满￥1000.00元；</td>
						</tr>
						<tr>
							<th>金级会员</th>
							<td>：  年内消费满￥1000.00元；</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		
		<!--密码修改-->
		<div class="member_info m4">
			<div class="guid_tit">
				<i></i>
				密码修改
			</div>
			<form action="{{U('Individual/changePassword')}}" method="post">
				<table border="0" cellspacing="0" cellpadding="0">
					<tbody>
						<tr>
							<th>旧密码：</th>
							<td>
								<input type="text" name="oldPassword" required=""/>
							</td>
						</tr>
						<tr>
							<th>新密码：</th>
							<td>
								<input type="text" name="newPassword" required=""/>
							</td>
						</tr>
						<tr>
							<th>确认新密码：</th>
							<td>
								<input type="text" name="confirmPassword" required=""/>
							</td>
						</tr>
					</tbody>
				</table>					
				<!--线-->
				<div class="row"></div>
				<div class="upbtnbox">
					<div class="upbtn">
						<input type="submit" value="保存修改"/>
					</div>
				</div>
			</form>	
		</div>
		
		<!--收货地址-->
		<div class="member_info m5">
			<!--添加地址弹窗-->
			<form action="{{U('Individual/addressAdd')}}" method="post">				
				<div class="modify_address add_address">
					<div class="guid_tit">
						<i></i>
						添加收货地址
					</div>
					<div class="closebtn">
						<a href="javascript:;">[关闭]</a>
					</div>
					<table border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<th>姓名：</th>
								<td>
									<input name="uname" type="text" />
								</td>
							</tr>
							<tr>
								<th>手机：</th>
								<td>
									<input name="phone" type="text" />
								</td>
							</tr>
							<tr>
								<th>地区：</th>
								<td>
									<select name="address[]" id="address1"></select>
									<select name="address[]" id="address2"></select>									
									<select name="address[]" id="address3"></select>
								</td>
							</tr>
							<tr>
								<th>地址：</th>
								<td>
									<input name="address_detail" type="text" />
								</td>
							</tr>
							<tr>
								<th>邮编：</th>
								<td>
									<input name="Postcode" type="text" />
								</td>
							</tr>
							<tr>
								<th>验证码：</th>
								<td>
									<input class="code" name="code" type="text" />
									<!--验证码图片 可点击图片刷新-->
									<img id="img" src="{{U('Member/Code')}}" onClick="this.src='{{U('Member/Code')}}'"/>
									<p id="btnp" >看不清换一张</p>
								</td>
							</tr>
							<tr>
								<th></th>
								<td>
									<input class="modify_btn" type="submit" value="保存"/>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</form>			
			<!--弹窗结束-->
			
			<div class="guid_tit">
				<i></i>
				收货地址
			</div>
			<script type="text/javascript">
				$(function(){
					$('#uul li').click(function(){
						//选中地址后改变颜色
						$(this).addClass('de_add').siblings().removeClass('de_add').addClass('address_li');
						//获取用户选择地址id
						var uaId = $(this).attr('uaId');
						$.ajax({
							type:"post",
							url:"{{U('Individual/defaultAddressShow')}}",
							data:{u:uaId},
							dataType:'json',
							//服务器返回数据				
							success:function(phpData){
								console.log(phpData);	
							}
						});						
					})
				})
			</script>
			<ul id="uul">							
				{{foreach from="$addressData" key="$k" value="$v"}}
				<li {{if value="$v['de_address'] == 1"}}class="de_add"{{else}}class="address_li"{{endif}} uaId="{{$v['uaid']}}">
					<div class="add_hd">
						{{$v['address'][0]}}
						<span>{{$v['address'][1]}}</span>
						<span>({{$v['uname']}}收)</span>
						<br />
					</div>
					<div class="add_bd">
						<span>{{$v['address_detail']}}</span>
						<span>{{$v['Postcode']}}</span>
						<span>{{$v['phone']}}</span>
					</div>
					<p>默认地址</p>
					<div class="set_default">
						<!--<a class="default_address" href="{{U('Individual/setAddress',['uaid'=>$v['uaid']])}}">设为默认</a>-->
						<a class="edit" href="javascript:;" uaid="{{$v['uaid']}}">编辑</a>
						<a href="javascript:if(confirm('确定删除吗？'))location.href='{{U('Individual/delAddress',['uaid'=>$v['uaid']])}}'">删除</a>
					</div>
					<i></i>
				</li>
				{{endforeach}}	
						
			</ul>
			<div class="add_function">
				<a href="javascript:;">使用新地址</a>
			</div>
			
			<script type="text/javascript">
				$('.edit').click(function(){
					var uaid = $(this).attr('uaid');
					$.ajax({
						type:"post",
						url:"{{U('Individual/addressShow')}}",
						data:{uaid:uaid},
						dataType:'json',
						//服务器返回数据				
						success:function(phpData){
							console.log(phpData);	
							$('.address_uname').val(phpData.uname);	// 姓名																						
							$('.address_postcode').val(phpData.Postcode);	// 邮箱	
							$('.address_phone').val(phpData.phone);	// 联系方式	
							$('.address_detail_edit').val(phpData.address_detail);	//地址	
							$('.address_uid').val(phpData.uaid); // 当前地址id	
							//城市联动数据
							area.selected(phpData.province,phpData.city,phpData.county);												
						}	
					});
				})
			</script>	
					
			<!--修改地址弹窗-->
			<form action="{{U('Individual/addressEdit')}}" method="post">
				<!--save 隐藏域-->	
				<input class="address_uid" type="hidden" name="uaid"  value="" />			
				<div class="modify_address edit_address">
					<div class="guid_tit">
						<i></i>
						修改收货地址
					</div>
					<div class="closebtn">
						<a href="javascript:;">[关闭]</a>
					</div>
					<table border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<th>姓名：</th>
								<td>
									<input class="address_uname" name="uname" type="text" />
								</td>
							</tr>
							<tr>
								<th>手机：</th>
								<td>
									<input class="address_phone" name="phone" type="text" />
								</td>
							</tr>
							<tr>
								<th>地区：</th>
								<td>
									<select name="address[]" id="addressAdit1"></select>
									<select name="address[]" id="addressAdit2"></select>									
									<select name="address[]" id="addressAdit3"></select>
								</td>
							</tr>
							<tr>
								<th>地址：</th>
								<td>
									<input class="address_detail_edit" name="address_detail" type="text" />
								</td>
							</tr>
							<tr>
								<th>邮编：</th>
								<td>
									<input class="address_postcode" name="Postcode" type="text" />
								</td>
							</tr>
							<tr>
								<th>验证码：</th>
								<td>
									<input class="code" name="code" type="text" />
									<!--验证码图片 可点击图片刷新-->
									<img id="img" src="{{U('Member/Code')}}" onClick="this.src='{{U('Member/Code')}}'"/>
									<p id="btnp" >看不清换一张</p>
								</td>
							</tr>
							<tr>
								<th></th>
								<td>
									<input class="modify_btn" type="submit" value="保存"/>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</form>			
			<!--弹窗结束-->
		</div>	
	</div>
</nav>

<!--回到首页-->
<a class="warp" href=""><img src="./Public/Home/images/Home.png"/></a>


<!--载入公共模板-->
{{include file="../Common/footer"}}
